<template>
  <div class="keybard">
    <button class="btn" @click="nuber('X')">X</button>
    <div class="key k1">
      <li v-for="itm in numbers" :key="itm" @click="nuber(itm)">{{ itm }}</li>
    </div>
    <div class="key k2">
      <li
        v-for="itm in numbers2"
        :key="itm"
        @click="nuber(itm)"
        class="iconfont"
        :class="
          itm == 'delete'
            ? 'el-icon-shanchu'
            : itm == 'enter'
            ? 'el-icon-enter'
            : ''
        "
      >
        {{ Number.isFinite(itm) ? itm : "" }}
      </li>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      numbers: [1, 2, 3, 4, 5, 6],
      numbers2: [7, 8, 9, 0, "delete", "enter"],
    };
  },
  methods: {
    nuber(val) {
      this.$emit("changeKey", val);
    },
  },
};
</script>

<style scoped>
.keybard {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 55px 25px 20px;
  box-sizing: border-box;
  border-top: 1px solid #eeeeee;
  background: rgb(255, 255, 255);
}
.btn {
  position: absolute;
  top: -18%;
  right: 2%;
  font-size: 35px;
  background: #fff;
  padding: 15px 50px;
}
.key {
  display: flex;
}
.key li {
  padding: 15px 5%;
  flex: 1;
  margin-right: 3%;
  margin-bottom: 25px;
  border-radius: 10px;
  font-size: 32px;
  font-weight: bold;
  background: #008080;
  color: #fff;
}
.key li:last-child {
  margin-right: 0;
}
</style>
